/*
 * Copyright © 2011 by Rob Cash
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 * PlugIn.java
 *
 * Created on Jun 25, 2011 at 2:59:50 PM
 */
package org.robcash.commons.plugin;

/**
 * Pluggable functionality that can be added to and removed from the
 * application.
 * @author Rob Cash
 */
public interface PlugIn
{
	/**
	 * Called on the plug-in when it is instantiated by a plug-in manager.
	 * @throws PlugInException Thrown if the plug-in cannot be initialized.
	 */
	void onInit() throws PlugInException;

	/**
	 * Called on the plug-in when it is registered with or discovered by a
	 * {@link PlugInManager}.
	 * @throws PlugInException Thrown if the plug-in cannot be registered.
	 */
	void onRegister() throws PlugInException;

	/**
	 * Called on the plug-in when it is about to be unregistered from a
	 * {@link PlugInManager}.
	 * @throws PlugInException Thrown if the plug-in cannot be unregistered.
	 */
	void onUnregister() throws PlugInException;

}
